package com.simin.mall.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

/**
 * Created by wsm on 2025/5/22
 * <p>
 */
abstract class BaseKtActivity<VB : ViewBinding> : BaseActivity() {

    private var _binding: VB? = null
    protected val binding get() = _binding!!

    override fun initView(savedInstanceState: Bundle?) {
        _binding = inflateBinding(layoutInflater)
        setContentView(binding.root)
        initData()
    }

    override fun loadData() {

    }

    override fun onDestroy() {
        super.onDestroy()
        _binding = null
    }

    protected abstract fun inflateBinding(inflater: LayoutInflater): VB
    protected abstract fun initData()
}